<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>收费界面</title>
</head>
<body>
<script type="text/javascript">
$(function(){
		//药品结算事件
		$('#yaodanshoufei-table').datagrid({
		//单击事件   
		onDblClickRow:function(rowIndex,rowData){
			var yaopin=$("#yaodanshoufei-table").datagrid("getSelected");
			 $("#ypzj").text(yaopin.prescription_money); //取到选中行的金额显示出来 
			 $('#ypsf').val(0);//实收
			 $('#ypzl').text(0);//找零
			 $('#ypyh').text(0);//优惠
			 $("#ypys").text(0);//应收
		},
		onClickRow:function(rowIndex,rowData){
			$("#ypzj").text(0); //取到选中行的金额显示出来 
			 $('#ypsf').val(0);//实收
			 $('#ypzl').text(0);//找零
			 $('#ypyh').text(0);//优惠
			 $("#ypys").text(0);//应收
		}
	});
	
	//体检结算事件
	$('#tijian_table').datagrid({
		//单击事件   
		onDblClickRow:function(rowIndex,rowData){
		var tijian=$("#tijian_table").datagrid("getSelected");
		 $("#tjzj").text(tijian.zongjine); //取到选中行的金额显示出来 
		 $('#tjsf').val(0);//实收
		 $('#tjzl').text(0);//找零
		 $('#tjyh').text(0);//优惠
		 $("#tjys").text(0);//应收
		},
		onClickRow:function(rowIndex,rowData){
			 $("#tjzj").text(0);
			 $('#tjsf').val(0);//实收
			 $('#tjzl').text(0);//找零
			 $('#tjyh').text(0);//优惠
			 $("#tjys").text(0);//应收
		}
	});
	
	
	//体检结算事件
	$('#xiangmu_table').datagrid({
		//单击事件   
		onDblClickRow:function(rowIndex,rowData){
		var xmh=$("#xiangmu_table").datagrid("getSelected");
		 $("#xmzj").text(xmh.project_zje);//取到选中行的金额显示出来
		 $('#sf').val(0);//实收
		 $('#zl').text(0);//找零
		 $('#yh').text(0);//优惠
		 $("#xmyf").text(0);//应收
		},
		onClickRow:function(rowIndex,rowData){
			 $("#xmzj").text(0);
			 $('#sf').val(0);//实收
			 $('#zl').text(0);//找零
			 $('#yh').text(0);//优惠
			 $("#xmyf").text(0);//应收
		}
	});
});
//时间转换
function comformatDate(date) {
	var day = new Date(date); 
	var Year = 0; 
	var Month = 0; 
	var Day = 0; 
	var CurrentDate = ""; 
	//初始化时间 
	Year= day.getFullYear();//
	Month= day.getMonth()+1; 
	Day = day.getDate(); 
	Hour = day.getHours(); 
	 Minute = day.getMinutes(); 
	 Second = day.getSeconds(); 
	CurrentDate += Year + "-"; 
	if (Month >= 10 ) { 
		CurrentDate += Month + "-"; 
	}else { 
		CurrentDate += "0" + Month + "-"; 
	} 
	if (Day >= 10 ) { 
		CurrentDate += Day ; 
	}else { 
		CurrentDate += "0" + Day ; 
	} 
	if(Hour>=10){
		CurrentDate +=" "+Hour;
	}else{
		CurrentDate +=" "+"0"+Hour;
	}
	if(Minute>=10){
		CurrentDate +=":"+Minute;
	}else{
		CurrentDate +=":"+"0"+Minute;
	}
	if(Second>=10){
		CurrentDate +=":"+Second;
	}else{
		CurrentDate +=":"+"0"+Second;
	}
	return CurrentDate; 
};
		$(function(){
			//访问数据源、初始化表格 ----药单收费上
			$('#yaodanshoufei-table').datagrid({
			    url:'findwjf',
			    fitColumns:true,
				pagination:true,
				/* rownumbers:true, */
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[
			    	{field:'prescription_id',hidden:true,title:'药方主表编号',align:'center'},
					{field:'outpatient_id',hidden:true,title:'门诊号',width:190,align:'center'},
					{field:'mecard_number',title:'医疗卡编号',width:130,align:'center'},
					{field:'patient_name',title:'病人姓名',width:130,align:'center'},
					{field:'patient_age',title:'病人年龄',width:130,align:'center'},
					{field:'patient_sex',title:'病人性别',width:140,align:'center'},
					{field:'prescription_name',title:'开方医生',width:140,align:'center'},
					{field:'Prescribing_date',title:'开方时间',width:140,align:'center',formatter:comformatDate},
					{field:'prescription_money',title:'总金额',width:140,align:'center'},
					{field:'yaodanshoufei-tableH',title:'详情',width:90,align:'center',
						formatter:function(value,row,index){
							return "<input type='button' style='background:#E4F1FB;color:#2779AA;border:none' onclick='xmfyxq("+row.prescription_id+")' value='详情'/>"
						}}	
			    ]],   
			});	
		});
		/*药品详情事件 ====================================*/
		function xmfyxq(row){
			 $('#ypsfxq').datagrid({
			    url:'idFindxq?prescription_id='+row,  
			    columns:[[
			    	{field:'drug_id',title:'药品编号',width:118,align:'center'},
					{field:'drug_name',title:'名称',width:118,align:'center'},
					{field:'drug_selling_price',title:'价格',width:118,align:'center'},
					{field:'drug_types_name',title:'类型',width:118,align:'center'},
					{field:'prescription_details_sl',title:'数量',width:116,align:'center'},
			    ]]
			}); 
			$("#yaopingshoufeixq").window("open");
		}
		$(function(){
			//访问数据源、初始化表格-----药单收费下
			$('#zl_table').datagrid({
			    url:'findyfchanger',
				pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[
					{field:'mecard_number',title:'医疗卡编号',width:150,align:'center'},
					{field:'ypfcharge_id',title:'收费编号',width:93,align:'center'},
					{field:'patient_name',title:'病人姓名',width:80,align:'center'},
					{field:'patient_sex',title:'病人性别',width:80,align:'center'},
					{field:'prescription_ss',title:'实收',width:93,align:'center'},
					{field:'prescription_ys',title:'应收',width:93,align:'center'},
					{field:'prescription_zl',title:'找零',width:93,align:'center'},
					{field:'prescription_yh',title:'优惠',width:93,align:'center'},
					{field:'yf_changer_date',title:'收费时间',width:110,align:'center',formatter:comformatDate},
					{field:'yfsfr',title:'收费人',width:80,align:'center'},
			    ]]
			});
		});
		$(function(){
			//访问数据源、初始化表格-----体检收费上
			$('#tijian_table').datagrid({
			    url:'djdl',
				pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[
					{field:'examine_id',title:'体检编号',width:140,align:'center'},
					{field:'patient_name',title:'病人姓名',width:120,align:'center'},
					{field:'patient_age',title:'病人年龄',width:140,align:'center'},
					{field:'patient_sex',title:'病人性别',width:120,align:'center'},
					{field:'card_cid',title:'病人身份证号',width:160,align:'center'},
					{field:'examine_time',title:'开设时间',width:180,align:'center',formatter:comformatDate},
					{field:'zongjine',title:'总金额',width:120,align:'center'},
					{field:'tj-tableH',title:'详情',width:120,align:'center',
						formatter:function(value,row,index){
							return "<input type='button' style='background:#E4F1FB;color:#2779AA;border:none' onclick='tjfyxq("+row.examine_id+")' value='详情'/>"
						}}
			    ]]
			});
			
		});
		/*体检项目详情事件 ====================================*/
		function tjfyxq(row){
			$('#tjxmxq').datagrid({
			    url:'idtjdl?examine_id='+row,
			    columns:[[
			    	{field:'examine_item_id',title:'项目编号',width:590/3,align:'center'},
					{field:'examine_item_name',title:'名称',width:590/3,align:'center'},
					{field:'examine_item_price',title:'价格',width:590/3,align:'center'},
			    ]]
			
			});
			$("#tijianshoufeixq").window("open");
		};
		$(function(){
			//访问数据源、初始化表格-----体检收费下
			$('#tijian_shoufeipx').datagrid({
			    url:'findtjsfjl',
				pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[
					{field:'examine_id',title:'体检编号',width:94,align:'center'},
					{field:'tjsfjlb_tb_id',title:'收费编号',width:94,align:'center'},
					{field:'patient_name',title:'病人姓名',width:94,align:'center'},
					{field:'patient_age',title:'病人年龄',width:94,align:'center'},
					{field:'patient_sex',title:'病人性别',width:94,align:'center'},
					
					{field:'tj_ss',title:'实收',width:93,align:'center'},
					{field:'tj_ys',title:'应收',width:93,align:'center'},
					{field:'tj_zl',title:'找零',width:94,align:'center'},
					{field:'tj_yh',title:'优惠',width:94,align:'center'},
					{field:'tjdate',title:'收费时间',width:170,align:'center',formatter:comformatDate},
					{field:'tjsfr',title:'收费人',width:94,align:'center'},
			    ]]
			});
		});
		$(function(){
			//访问数据源、初始化表格-----治疗项目收费上
			$('#xiangmu_table').datagrid({
			    url:'findCrueCost',
				pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[	
			    	{field:'outpatient_id', hidden:true,title:'',width:80,align:'center'},
			    	{field:'mzcard_id', hidden:true,title:'',width:80,align:'center'},
			    	{field:'cure_cost_id', hidden:true,title:'',width:80,align:'center'},//医疗项目费用单改单id
					{field:'mecard_number',title:'医疗卡编号',width:170,align:'center'},
					{field:'patient_name',title:'病人姓名',width:100,align:'center'},
					{field:'patient_age',title:'病人年龄',width:100,align:'center'},
					{field:'patient_sex',title:'病人性别',width:90,align:'center'},
					{field:'card_cid',title:'病人身份证号',width:160,align:'center'},
					{field:'xmys',title:'治疗医生',width:120,align:'center'},
					{field:'project_zje',title:'总金额',width:120,align:'center'},
					{field:'project_date',title:'开方时间',width:160,align:'center',formatter:comformatDate},
					{field:'xiangmu_tableH',title:'详情',width:90,align:'center',
						formatter:function(value,row,index){
							return "<input type='button' style='background:#E4F1FB;color:#2779AA;border:none' onclick='xmxq("+row.cure_cost_id+")' value='详情'/>"
						}}	
			    ]]
			});
		});
		/*治疗项目详情事件 ====================================*/		
		function xmxq(row){//通过上面的详情的点击事件得到主表记录id作为参数查询详表信息
			$('#zlxmxq').datagrid({
			    url:'idMzcostDetails?cure_cost_id='+row,  
			    columns:[[
			    	{field:'cure_id',title:'项目编号',width:590/3,align:'center'},
					{field:'cure_name',title:'名称',width:590/3,align:'center'},
					{field:'cure_je',title:'价格',width:590/3,align:'center'},
			    ]]
			});
			$("#zhiliaoxiangmuxq").window("open");
		};
		$(function(){
			//访问数据源、初始化表格-----治疗项目收费下
			$('#xiangmushoufei_pxh').datagrid({
			    url:'findxmsfjl',
				pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[
					{field:'mecard_number',title:'医疗卡编号',width:153,align:'center'},
					{field:'mzcost_details_record_id',title:'收费编号',width:102,align:'center'},
					{field:'patient_name',title:'病人姓名',width:102,align:'center'},
					{field:'patient_age',title:'病人年龄',width:102,align:'center'},
					{field:'patient_sex',title:'病人性别',width:102,align:'center'},
					{field:'xmprescription_ss',title:'实收',width:101,align:'center'},
					{field:'xmprescription_ys',title:'应收',width:101,align:'center'},
					{field:'xmprescription_zl',title:'找零',width:101,align:'center'},
					{field:'xmprescription_yh',title:'优惠',width:101,align:'center'},
					{field:'charge_xmdate',title:'收费时间',width:152,align:'center',formatter:comformatDate},
					{field:'xmsfr',title:'收费人',width:100,align:'center'},
			    ]]
			});
		});
		$(function(){
			//访问数据源、初始化表格-----药单退费上
			$('#yaodantuifei_pxh').datagrid({
			    url:'yaofangtuifei',
				pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,6],
			    columns:[[
			    	{field:'yaodantuifei_pxhAA',title:'',checkbox:true},
					{field:'mecard_number',title:'医疗卡编号',width:200,align:'center'},
					{field:'return_id',title:'药单编号',width:200,align:'center'},
					{field:'patient_name',title:'病人姓名',width:200,align:'center'},
					{field:'zje',title:'退货总金额',width:180,align:'center'},
					{field:'zsl',title:'退货总数量',width:180,align:'center'},
					{field:'xiangmu_tableH',title:'详情',width:100,align:'center',
						formatter:function(value,row,index){
							return "<input type='button' style='background:#E4F1FB;color:#2779AA;border:none' onclick='tyxq("+row.return_id+")' value='详情'/>"
						}}
			    ]]
			});
		});
		//退药详情
		function tyxq(row){
			$('#tuiyaoxingqing').datagrid({
			    url:'tycxq?return_id='+row,
			    columns:[[
			    	{field:'drug_id',title:'编号',width:590/5,align:'center'},
					{field:'drug_name',title:'名称',width:590/5,align:'center'},
					{field:'redetai_number_yf',title:'数量',width:590/5,align:'center'},
					{field:'redetai_money_yf',title:'价格',width:590/5,align:'center'},
			    ]]
			});
			$("#yaopingtui").window("open");
		}
		//打印药品收费单据
		$(function(){
			$("#ypdy").click(function(){
				var yfzbid=$('#yfzbid').val();//得到药方主表id
				$.ajax({
					url:'ypiddapj?prescription_id='+yfzbid,
					type:'post',
					success:function(d){
						if(d!=null){
							$("#yfbrxm").text(d[0]["patient_name"]); 
							$("#yfskr").text(d[0]["yfsfr"]); 
							$("#yfss").text(d[0]["prescription_ss"]);
							$("#yfys").text(d[0]["prescription_ys"]);
							$("#yfzl").text(d[0]["prescription_zl"]);
							$("#yfyh").text(d[0]["prescription_yh"]);
							var dateee = new Date(d[0]["yf_changer_date"]).toJSON();
							var date= new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); 
							//体检项目收费时间
							$("#ypsfsj").text(date);
							//体检项目收费单号
							var date = new Date(+new Date()+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'');
							var  hhhh=date.toString().replace("-", "");
							var  hhhhh=hhhh.toString().replace(":", "");
							var  aa=hhhhh.toString().replace(":", "");
							var  aaa=aa.toString().replace("-", "");
							var  aaaa=aaa.toString().replace(" ", "");
							$("#ypsfbh").text(aaaa);
							var yfzbid=$('#yfzbid').val();//得到药方主表id
							 $('#yaopingshoufeidj').datagrid({
								    url:'idFindxq?prescription_id='+yfzbid,  
								    columns:[[
								    	{field:'drug_id',title:'药品编号',width:590/5,align:'center'},
										{field:'drug_name',title:'名称',width:590/5,align:'center'},
										{field:'drug_selling_price',title:'价格',width:590/5,align:'center'},
										{field:'drug_types_name',title:'类型',width:590/5,align:'center'},
										{field:'prescription_details_sl',title:'数量',width:590/5,align:'center'},
								    ]]
								}); 	
						}else{
							$.messager.alert("温馨提示：","项目票据内容为空");
						}
					}
				 }); 
				$("#yaopinshoufei").window("open");
				$("#ypsfwc").window("close");
			});
		});
		//打印体检收费单据
		$(function(){
			$("#tjdy").click(function(){
				var tjzbid=$('#tjzbid').val();//得到体检费用主表id
				$.ajax({
					url:'tjidDapj?examine_id='+tjzbid,
					type:'post',
					success:function(d){
						if(d!=null){
							$("#tjbrxm").text(d[0]["patient_name"]); 
							$("#tjskr").text(d[0]["tjsfr"]); 
							$("#tjzje").text(d[0]["tjsf_zje"]);
							$("#tjpjys").text(d[0]["tj_ys"]);
							$("#tjpjss").text(d[0]["tj_ss"]);
							$("#tjpjzl").text(d[0]["tj_zl"]);
							$("#tjpjyh").text(d[0]["tj_yh"]);
							
							var dateee = new Date(d[0]["tjdate"]).toJSON();
							var date= new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); 
							//体检项目收费时间
							$("#tjsfsj").text(date);
							//体检项目收费单号
							var date = new Date(+new Date()+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'');
							var  hhhh=date.toString().replace("-", "");
							var  hhhhh=hhhh.toString().replace(":", "");
							var  aa=hhhhh.toString().replace(":", "");
							var  aaa=aa.toString().replace("-", "");
							var  aaaa=aaa.toString().replace(" ", "");
							$("#tjsfbh").text(aaaa);
							
							
							var tjzbid=$('#tjzbid').val();//得到体检费用主表id
							$('#tijianshoufeidj').datagrid({
							    url:'idtjdl?examine_id='+tjzbid,
							    columns:[[
							    	{field:'examine_item_id',title:'项目编号',width:590/3,align:'center'},
									{field:'examine_item_name',title:'名称',width:590/3,align:'center'},
									{field:'examine_item_price',title:'价格',width:590/3,align:'center'},
							    ]]
							
							});
						}else{
							$.messager.alert("温馨提示：","项目票据内容为空");
						}
					}
				});	
				$("#tijianshoufei").window("open");
				$("#tjsfwc").window("close");
				
			});
		});
		
		//打印治疗项目收费单据
		$(function(){
			$("#xmdy").click(function(){
				var xmzbid=$('#xmzbid').val();//得到项目费用主表id
				$.ajax({
					url:'xmidDpj?cure_cost_id='+xmzbid,
					type:'post',
					success:function(d){
						if(d!=null){
							$("#xmbrxm").text(d[0]["patient_name"]); 
							$("#xmskr").text(d[0]["xmsfr"]); 
							$("#xmpjzj").text(d[0]["charge_xmjze"]);
							$("#xmpjys").text(d[0]["xmprescription_ys"]);
							$("#xmpjss").text(d[0]["xmprescription_ss"]);
							$("#xmpjzl").text(d[0]["xmprescription_zl"]);
							$("#xmpjyh").text(d[0]["xmprescription_yh"]);
							var dateee = new Date(d[0]["charge_xmdate"]).toJSON();
							var date= new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); 
							//医疗项目收费时间
							$("#xmsfsj").text(date);
							//医疗项目收费单号
							var date = new Date(+new Date()+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'');
							var  hhhh=date.toString().replace("-", "");
							var  hhhhh=hhhh.toString().replace(":", "");
							var  aa=hhhhh.toString().replace(":", "");
							var  aaa=aa.toString().replace("-", "");
							var  aaaa=aaa.toString().replace(" ", "");
							$("#xmsfbh").text(aaaa);
							var xmzbid=$('#xmzbid').val();//得到项目费用主表id//再给表格赋值
							$('#zhiliaoxiangmudj').datagrid({
							    url:'idMzcostDetails?cure_cost_id='+xmzbid,  
							    columns:[[
							    	{field:'cure_id',title:'项目编号',width:590/3,align:'center'},
									{field:'cure_name',title:'名称',width:590/3,align:'center'},
									{field:'cure_je',title:'价格',width:590/3,align:'center'},
							    ]]
							});
							
						}else{
							$.messager.alert("温馨提示：","项目票据内容为空");
						}
					}
				});
				$("#zhiliaoshoufei").window("open");
				$("#zlxmwc").window("close");
				
			});
		});
		//==============================================以下是一系列收据打印完成关闭弹框事件
		//药品票据打印完成关闭弹框事件
		$(function(){
			$("#ydwc").click(function(){
				$("#yaopinshoufei").window("close");
				$("#ypsfwc").window("close");
			})
		});
		//体检票据打印完成关闭弹框事件
		$(function(){
			$("#tjwc").click(function(){
				$("#tijianshoufei").window("close");
				$("#tjsfwc").window("close");
			})
		});
		//治疗项目票据打印完成关闭弹框事件
		$(function(){
			$("#xmwc").click(function(){
				$("#zhiliaoshoufei").window("close");
				$("#zlxmwc").window("close");
			})
		});
//医疗项目选中事件==========医疗项目收费事件
$(function(){
//实付input事件
$(function(){
	$("#sf").blur(function(){
		 var sf=$('#sf').val();
		 var xmzj=$('#xmzj').text();//得到项目总金额
		 if(sf==''){
			 $.messager.alert("温馨提示：","项目支付费用不能为空"); 
		 }else if(!(/^([1-9]\d*|[0]{1,1})$/).test(sf)){
			 /* $.messager.alert("温馨提示：","项目支付费用请输入大于零的数字");  */
			 $('#sf').val(0);
		 }else if(xmzj==0){
			 $.messager.alert("温馨提示：","您还未勾选医疗项目收费记录");
		 }else if(parseInt(sf)<parseInt(xmzj)){
			 $.messager.alert("温馨提示：","项目支付费用不够"); 
			 	 //给找零赋值
				 $("#zl").text(0);
				 //给优惠赋值
				 $("#yh").text(0);
				 return;
		 }else{
			 var zlxmyibao=$('#zlxmyibao_ option:selected').text();//得到是否有医保值 
			 if(zlxmyibao=='有'){
				 var xmzj=$('#xmzj').text();//得到项目总金额
				 var sf=$('#sf').val();//得到实付金额
				//用项目总金额*0.8===得到折后价
				 var zhj=parseFloat(xmzj)*parseFloat(0.8);
				 //算优惠--用项目总减去折后价就是优惠价
				 var tjyouhui=parseFloat(xmzj)-parseFloat(zhj);
				//算找零 用实付减去折后价就是找零
				 var tjzl=parseInt(sf)-parseInt(zhj);
				//应收  总计减优惠
				var ys=parseFloat(xmzj)-parseFloat(tjyouhui);	
				 //给找零赋值
				 $("#zl").text(tjzl);
				 //给优惠赋值
				 $("#yh").text(parseInt(tjyouhui));
				//给应收赋值
				 $("#xmyf").text(parseInt(ys));
			 }else{//没有医疗保险
				 var xmzj=$('#xmzj').text();//得到项目总金额
				 var sf=$('#sf').val();//得到实付金额
				 //算找零
				 var wybzl=parseFloat(sf)-parseFloat(xmzj);
				 //给找零赋值
				 $("#zl").text(wybzl);
				//给应收赋值
				 $("#xmyf").text(xmzj);
			 }	 
		 }
	});
}); 
$("#xmpxh").click(function(){
	 	var sf=$('#sf').val();
	 	 var xmzj=$('#xmzj').text();//得到项目总金额
	 	if(xmzj==0){
	 		 $.messager.alert("温馨提示：","您还未勾选医疗项目收费记录");
	 	}else if(sf==0){
	 		$.messager.alert("温馨提示：","项目支付费用不能为空"); 
	 	}else if(parseInt(sf)<parseInt(xmzj)){
	 		 $.messager.alert("温馨提示：","项目支付费用不够"); 
	 	}else{
	 		var xmh=$("#xiangmu_table").datagrid("getSelected");
			 var mzh=xmh.outpatient_id;//取到选中行的门诊号
			 var tjfyzbid=xmh.cure_cost_id;//取到选中行的改单项目主键id
			 $("#xmzbid").val(tjfyzbid);//把选中项目主表的id存进隐藏域到打印票据的时候调用
			 var xmzj=$('#xmzj').text();//得到项目总金额
			 var xmsf=$('#sf').val();//实收
			 var xmzl=$('#zl').text();//找零
			 var xmyh=$('#yh').text();//优惠
			 var xmys= $("#xmyf").text();//应收 
/* 			 alert("项目总金额"+xmzj+"实收"+xmsf+"找零"+xmzl+"优惠"+xmyh+"应收"+xmys+"门诊号"+mzh);
 */			 if(mzh==''){
				 $.messager.alert("温馨提示：","门诊号不能为空");
			 }else if(tjfyzbid==''){
				 $.messager.alert("温馨提示：","体检编号不能为空");
			 }else if(xmzj==''){
				 $.messager.alert("温馨提示：","项目总金额不能为空");
			 }else if(xmsf==''){
				 $.messager.alert("温馨提示：","项目实收不能为空");
			 }else if(xmzl==''){
				 $.messager.alert("温馨提示：","项目找零不能为空");
			 }else if(xmys==''){
				 $.messager.alert("温馨提示：","项目应收不能为空");
			 }else if(xmyh==''){
				 $.messager.alert("温馨提示：","项目优惠不能为空");
			 }else{
				 $.ajax({
					 url:'addylxm',
					 type:'post',
					 data:{
						"outpatient_id":mzh,
						"cure_cost_id":tjfyzbid,
						"charge_xmjze":xmzj,
						"xmprescription_ss":xmsf,
						"xmprescription_zl":xmzl,
						"xmprescription_yh":xmyh,
						"xmprescription_ys":xmys
					 },
					 success:function(d){
						 if(parseInt(d)==1){
							 $('#xmzj').text(0);//得到项目总金额
							 $('#sf').val(0);//实收
							 $('#zl').text(0);//找零
							 $('#yh').text(0);//优惠
							 $("#xmyf").text(0);//应收
				 
				 			$("#zlxmwc").window("open");
				 			$("#xiangmu_table").datagrid("reload"); 
					 		}else{
					 			$.messager.alert("温馨提示：","项目收费记录失败"); 
					 		}
					 }
				 });
			 }
	 	} 
	});
});
//==================药品收费事件
 $(function(){ 
$(function(){
		$("#ypsf").blur(function(){
			 var sf=$('#ypsf').val();
			 var ypzj=$('#ypzj').text();//得到药品总金额
			 if(sf==''){
					$.messager.alert("温馨提示：","药品支付费用不能为空"); 
			 }else if(!(/^([1-9]\d*|[0]{1,1})$/).test(sf)){
				/*  $.messager.alert("温馨提示：","药品支付费用请输入大于零的数字"); */
				$('#ypsf').val(0);
			 }else if(ypzj==0){
				 $.messager.alert("温馨提示：","您还未勾选药方费用记录");
			 }else if(parseInt(sf)<parseInt(ypzj)){
					$.messager.alert("温馨提示：","药品支付费用不够");
				  	//给找零赋值
					 $("#ypzl").text(0);
					 //给优惠赋值
					 $("#ypyh").text(0);
					 return;
			 }else{
				 var ypyibao=$('#ypyibao option:selected').text();//得到是否有医保值 
				 if(ypyibao=='有'){
					 var ypzj=$('#ypzj').text();//得到项目总金额
					 var ypsf=$('#ypsf').val();//得到实付金额
					//用药品总金额*0.8===得到折后价
					 var ypzhj=parseFloat(ypzj)*parseFloat(0.8);
					 //算优惠--用药品总减去折后价就是优惠价
					 var ypyouhui=parseInt(ypzj)-parseInt(ypzhj);
					//算找零 用实付减去折后价就是找零
					 var ypzl=parseInt(ypsf)-parseInt(ypzhj);
					//应收  总计减优惠
					var ypys=parseFloat(ypzj)-parseFloat(ypyouhui);	
					
					 //给找零赋值
					 $("#ypzl").text(ypzl);
					 //给优惠赋值
					 $("#ypyh").text(ypyouhui);
					//给应收赋值
					 $("#ypys").text(ypys);
					 
				 }else{//没有医疗保险
					 var ypzj=$('#ypzj').text();//得到项目总金额
					 var ypsf=$('#ypsf').val();//得到实付金额
					 //算找零
					 var ypwybzl=parseFloat(ypsf)-parseFloat(ypzj);
					 //给找零赋值
					 $("#ypzl").text(ypwybzl);
					 
					//给应收赋值
					 $("#ypys").text(ypzj);	 
				 }	 
			 } 
		});	
	});
//药品确认收费事件
$(function(){
	$("#ydpxh").click(function(){
		 var sf=$('#ypsf').val();
		 var ypzj=$('#ypzj').text();//得到药品总金额
		 if(ypzj==0){
			 $.messager.alert("温馨提示：","您还未勾选药方费用记录");
		 }else if(sf==0){
			 $.messager.alert("温馨提示：","药品支付费用不能为空"); 
		 }else if(parseInt(sf)<parseInt(ypzj)){
			 $.messager.alert("温馨提示：","药品支付费用不够");
		 }else if(!(/^([1-9]\d*|[0]{1,1})$/).test(sf)){
			 $.messager.alert("温馨提示：","药品支付费用请输入大于零的数字"); 
		 }else{
			 var ypbiao=$("#yaodanshoufei-table").datagrid("getSelected");
				var mzh=ypbiao.outpatient_id//得到门诊号
				var yfid=ypbiao.prescription_id//得到药方主表编号
					$("#yfzbid").val(yfid);//把选中药方主表的id存进隐藏域到打印票据的时候调用
				 var ypzj=$('#ypzj').text();//得到药品总金额
				 var ypsf=$('#ypsf').val();//实收
				 var ypzl=$('#ypzl').text();//找零
				 var ypyh=$('#ypyh').text();//优惠
				 var ypys= $("#ypys").text();//应收
				 var kfys=ypbiao.prescription_name;//开方医生
/* 				 alert("总金额"+ypzj+"实收"+ypsf+"找零"+ypzl+"优惠"+ypyh+"应收拉"+ypys+"门诊号"+mzh+"药方编号"+yfid);
 */				 if(mzh==''){
					 $.messager.alert("温馨提示：","门诊号不能为空");
				 }else if(yfid==''){
					 $.messager.alert("温馨提示：","药方编号不能为空");
				 }else if(ypzj==''){
					 $.messager.alert("温馨提示：","药方总金额不能为空");
				 }else if(ypsf==''){
					 $.messager.alert("温馨提示：","药方实收不能为空");
				 }else if(ypzl==''){
					 $.messager.alert("温馨提示：","药方找零不能为空");
				 }else if(ypyh==''){
					 $.messager.alert("温馨提示：","药方优惠不能为空");
				 }else if(ypys==''){
					 $.messager.alert("温馨提示：","药方应收不能为空");
				 }else if(kfys==''){
					 $.messager.alert("温馨提示：","开方医生不能为空");
				 }else {
					 $.ajax({
						 	url:'addyfsfjl',
						 	type:'post',
						 	data:{
						 		"outpatient_id":mzh,
						 		"prescription_id":yfid,
						 		"prescription_ys":ypys,
						 		"prescription_ss":ypsf,
						 		"prescription_zl":ypzl,
						 		"prescription_yh":ypyh,
						 		"prescription_name":kfys
						 	},
						 	success:function(d){
						 		 if(parseInt(d)==1){
						 				$('#ypzj').text(0);//得到药品总金额
									 	$('#ypsf').val(0);//实收
										$('#ypzl').text(0);//找零
										$('#ypyh').text(0);//优惠
										$("#ypys").text(0);//应收
							 			
							 			$("#ypsfwc").window("open");
							 		 	$("#yaodanshoufei-table").datagrid("reload");
							 		 	$("#zl_table").datagrid("reload");
							 		}else{
							 			$.messager.alert("温馨提示：","药方收费失败");
							 		}
						 	}
					 }); 
				 }
		 }
	});
});
});
//体检收费===================
$(function(){
	$(function(){
		$("#tjsf").blur(function(){
			 var tjsf=$('#tjsf').val();
			 var tjzj=$('#tjzj').text();//得到体检总金额
			 if(tjsf==''){
				 $.messager.alert("温馨提示：","输入不能为空"); 
			 }else if(!(/^([1-9]\d*|[0]{1,1})$/).test(tjsf)){
				 /* $.messager.alert("温馨提示：","体检支付费用请输入大于零的数字"); */
				 $('#tjsf').val(0);
			 }else if(tjzj==0){
				 $.messager.alert("温馨提示：","您还未勾选体检收费记录");
			 }else if(parseInt(tjsf)<parseInt(tjzj)){
				 $.messager.alert("温馨提示：","体检支付费用不够");
				  	//给找零赋值
					 $("#tjzl").text(0);
					 //给优惠赋值
					 $("#tjyh").text(0);
					 return;
			 }else{
				 var tjyibao=$('#tjyibao option:selected').text();//得到是否有医保值 
				 if(tjyibao=='有'){
					 var tjzj=$('#tjzj').text();//得到项目总金额
					 var tjsf=$('#tjsf').val();//得到实付金额
					//用药品总金额*0.8===得到折后价
					 var tjzhj=parseFloat(tjzj)*parseFloat(0.8);
					 //算优惠--用药品总减去折后价就是优惠价
					 var tjyouhui=parseInt(tjzj)-parseInt(tjzhj);
					//算找零 用实付减去折后价就是找零
					 var tjzl=parseInt(tjsf)-parseInt(tjzhj);
					//应收  总计减优惠
					var tjys=parseFloat(tjzj)-parseFloat(tjyouhui);	
					 //给找零赋值
					 $("#tjzl").text(tjzl);
					 //给优惠赋值
					 $("#tjyh").text(tjyouhui);
					//给应收赋值
					 $("#tjys").text(tjys);
					 
				 }else{//没有医疗保险
					 var tjzj=$('#tjzj').text();//得到项目总金额
					 var tjsf=$('#tjsf').val();//得到实付金额
					 //算找零
					 var tjwybzl=parseFloat(tjsf)-parseFloat(tjzj);
					 //给找零赋值
					 $("#tjzl").text(tjwybzl);
					//给应收赋值
					 $("#tjys").text(tjzj); 
				 } 
			 }
		});
		
	});
//体检确认收费按钮
	$("#tjpxh").click(function(){
		 var tjsf=$('#tjsf').val();
		 var tjzj=$('#tjzj').text();//得到体检总金额
		 if(tjzj==0){
			 $.messager.alert("温馨提示：","您还未勾选体检收费记录");
		 }else if(tjsf==0){
			 $.messager.alert("温馨提示：","体检实付费用不能为空");
		 }else if(parseInt(tjsf)<parseInt(tjzj)){
			 $.messager.alert("温馨提示：","体检支付费用不够");
		 }else{
			 	var tijian=$("#tijian_table").datagrid("getSelected");
				var tjid=tijian.examine_id//得到体检主表编号
				$("#tjzbid").val(tjid);//把选中体检主表的id存进隐藏域到打印票据的时候调用
				 var tjzj=$('#tjzj').text();//得到体检总金额
				 var tjsf=$('#tjsf').val();//实收
				 var tjzl=$('#tjzl').text();//找零
				 var tjyh=$('#tjyh').text();//优惠
				 var tjys= $("#tjys").text();//应收
				 /* alert("总金额"+tjzj+"实收"+tjsf+"找零"+tjzl+"优惠"+tjyh+"应收拉"+tjys+"体检编号"+tjid); */
				 if(tjid==''){
					 $.messager.alert("温馨提示：","体检号不能为空");
				 }else if(tjzj==''){
					 $.messager.alert("温馨提示：","体检总计不能为空");
				 }else if(tjzl==''){
					 $.messager.alert("温馨提示：","体检找零不能为空");
				 }else if(tjyh==''){
					 $.messager.alert("温馨提示：","体检优惠不能为空");
				 }else if(tjys==''){
					 $.messager.alert("温馨提示：","体检应收不能为空");
				 }else{
					 $.ajax({
							url:'addtjsfjl',
							type:'post',
							data:{
						 		"examine_id":tjid,
						 		"tjsf_zje":tjzj,
						 		"tj_ys":tjys,
						 		"tj_ss":tjsf,
						 		"tj_zl":tjzl,
						 		"tj_yh":tjyh
							},
							success:function(d){
								 if(parseInt(d)==1){
									 $('#tjzj').text(0);//得到体检总金额
									 $('#tjsf').val(0);//实收
									 $('#tjzl').text(0);//找零
									 $('#tjyh').text(0);//优惠
									 $("#tjys").text(0);//应收
							 		 
							 		$("#tjsfwc").window("open");
							 		$("#tijian_table").datagrid("reload"); 
							 		}else{
							 			$.messager.alert("温馨提示：","体检收费失败");
							 		}
							}
						}); 
				 }	
		 }
	});
});
//==================药品退费事件
$(function(){
	//得到选中的金额
	$("#yaodantuifei_pxh").datagrid({
		onCheck:function(){
			var yaopin=$("#yaodantuifei_pxh").datagrid("getSelected");
			 $("#ydtfzj").text(yaopin.zje); //取到选中行的金额显示出来 
		},
		onUncheck:function(){
			 $("#ydtfzj").text(parseInt(0));
		}
	});
	//根据医疗卡号查询未交费的药单
	$("#medid").searchbox({
		searcher:function(value,name){
			$('#yaodanshoufei-table').datagrid({
			    url:'medfindwjf?mecard_number='+value
			}); 
		}
	});
	//根据医疗卡号查询以交费的药单
	 $("#card2").searchbox({
		searcher:function(value,name){
			$('#zl_table').datagrid({
			    url:'medfindyfchanger?mecard_number='+value
			});
		}
	}); 
	//根据体检号查询未交费的体检项目单
	 $("#card3").searchbox({
		searcher:function(value,name){
			$('#tijian_table').datagrid({
				 url:'carddjdl?examine_id='+value
			});
		}
	}); 
	//根据医疗卡号查询以交费的体检项目单
	 $("#card4").searchbox({
		searcher:function(value,name){
			$('#tijian_shoufeipx').datagrid({
				 url:'medfindtjsfjl?examine_id='+value
			});
		}
	}); 
	//根据医疗卡号查询未交费的治疗项目单
	$("#card5").searchbox({
		searcher:function(value,name){
			$('#xiangmu_table').datagrid({
				 url:'medfindCrueCost?mecard_number='+value
			});
		}
	});
	//根据医疗卡号查询未交费的治疗项目单
	$("#card6").searchbox({
		searcher:function(value,name){
			$('#xiangmushoufei_pxh').datagrid({
				 url:'mefindxmsfjl?mecard_number='+value
			});
		}
	});	
});
</script>
		<input type="hidden" type="text" id="yfzbid"><!-- 药方主表id储存 打印药方收费票据时调用-->
		<input type="hidden" type="text" id="tjzbid"><!-- 体检主表id储存 打印体检收费票据时调用-->
		<input type="hidden" type="text" id="xmzbid"><!-- 项目主表id储存 打印体检收费票据时调用-->
<div class="easyui-tabs" data-options="region:'west',title:'诊疗',split:true,collapsible:false"style="width:600;border:none">
		<div title="药品收费">
			<fieldset class="guhao_" style="border:none;border-radius:5px;width:1120px;">
						
					<div style="margin-top:5px;">
					<div style="border:1px solid none;float:left">
					
						<input name="K_id" id="medid" class="easyui-searchbox" 
								data-options="label:'医疗卡号：',prompt:'请输入医疗卡号',width:260,labelAlign:'right'">
						<select id="ypyibao" class="easyui-combobox"  panelHeight='auto'
								data-options="label:'有无医保：',width:150,labelAlign:'right'">   
				   				<option  selected="selected">有</option>   
				    			<option>无</option>   
						</select>
					</div>			
						<!--费用框  -->
						<div style="border:1px solid none;float:left;margin-top:5px;margin-left:15px;">	
								<div style="border:1px solid none;float:left;width:100px;">总计:<span style="color:red;width:100px;" id="ypzj">0</span>元</div>	
								<div style="border:1px solid none;float:left;width:80px;">优惠:<span id="ypyh"style="color:red;width:100px;">0</span>元</div>					
								<div style="border:1px solid none;float:left;width:130px;">应收:<span  id="ypys" style="color:red;width:100px;">0</span>元</div>
								<div style="border:1px solid none;float:left;width:130px;">实收:<input type="text" id="ypsf" value="0"style="color:red;width:50px;height:18px;font-size:15px;border:none;"/>元</div>
								<div style="border:1px solid none;float:left;width:110px;">找零:<span id="ypzl"style="color:red;width:100px;">0</span>元</div>
						</div>								
						<div style="border:1px solid none;folat:left;">		
								<span style="margin-left:20px;"><a class='easyui-linkbutton' id="ydpxh">确认收费</a></span>
						</div>		
					</div>
						<div class="y" style="margin-top:15px;">
							<table id="yaodanshoufei-table"  singleSelect="true" style="height:200px;width:1120px;margin:10px;">
							</table>
						</div>
				</fieldset>
				<!-- =============底部盒子===========  -->
		<div class="easyui-layout" style="width:550px;border:none;margin-top:15px;width:1140px;margin-left:10px;">
			<div class="di_6" style="border:none;margin-bottom:10px;" >
				<span>
					<input name="K_id" id="card2" class="easyui-searchbox" 
						data-options="label:'医疗卡号：',prompt:'请输入医疗卡号',width:260,labelAlign:'right'">
				</span>
			</div>
			<div class="yaodandi">
			<!-- 底部表格 -->
			<table id="zl_table" singleSelect="true" style="height:250px;width:1122px;" class="easyui-datagrid" data-options="fitColumns:true">
		 		
			</table>
			</div>
		</div>		 
	</div>
		<div title="体检收费">
			<fieldset class="tijian_px" style="border:none;border-radius:5px;width:1120px;">
				<div style="margin-top:5px;">
						<div style="border:1px solid none;float:left">
							<input name="K_id" id="card3" class="easyui-searchbox" 
								data-options="label:'体检号：',prompt:'请输入体检号',width:260,labelAlign:'right'">
								<select id="tjyibao" class="easyui-combobox"  panelHeight='auto'
										data-options="label:'有无医保：',width:150,labelAlign:'right'">   
		   									 <option selected="selected">有</option>   
		    								 <option>无</option>   
								</select>
						</div>		
							<!--体检费用框  -->
						<div style="border:1px solid none;float:left;margin-top:5px;margin-left:15px;">	
								<div style="border:1px solid none;float:left;width:100px;">总计:<span style="color:red;width:100px;" id="tjzj">0</span>元</div>	
								<div style="border:1px solid none;float:left;width:80px;">优惠:<span id="tjyh"style="color:red;width:100px;">0</span>元</div>					
								<div style="border:1px solid none;float:left;width:130px;">应收:<span  id="tjys" style="color:red;width:100px;">0</span>元</div>
								<div style="border:1px solid none;float:left;width:130px;">实收:<input type="text" id="tjsf" value="0"style="color:red;width:50px;height:18px;font-size:15px;border:none;"/>元</div>
								<div style="border:1px solid none;float:left;width:110px;">找零:<span id="tjzl"style="color:red;width:100px;">0</span>元</div>
						</div>
						<div style="border:1px solid none;folat:left;">		
								<span style="margin-left:20px;"><a class='easyui-linkbutton' id="tjpxh">确认收费</a></span>
						</div>
				</div>
				<div class="yy" style="margin-top:15px;">
					<table id="tijian_table" singleSelect="true" style="margin-top:10px;height:200px;width:1122px;">
					</table>
				</div>
		</fieldset>
			<!-- =============底部盒子===========  -->
		<div class="easyui-layout" style="width:550;border:none;margin-top:15px;width:1140px;margin-left:10px;">
			<div class="tijian_shoufei" style="border:none;margin-bottom:10px;">
				<span>
					<input name=""  id="card4" class="easyui-searchbox" 
					data-options="label:'体检号：',prompt:'请输入体检号',width:260,labelAlign:'right'">	
				</span>
			</div>
			<!-- 底部表格 tijian_shoufeipx-->
			<div class="tijandi">
				<!-- 底部表格 -->
				<table id="tijian_shoufeipx" singleSelect="true" style="height:250px;width:1122px;" class="easyui-datagrid" data-options="fitColumns:true">	
				</table>
			</div>
		</div>
		</div>
		<div title="治疗项目收费">
			<fieldset class="zhiliaoxiangmu_px" style="border:none;border-radius:5px;width:1120px;">	
				<div style="margin-top:5px;border:1px solid none;">
					<div style="border:1px solid none;float:left">
						<input name="K_id" id="card5" class="easyui-searchbox" 
						data-options="label:'医疗卡号：',prompt:'请输入医疗卡号',width:260,labelAlign:'right'">
						<select id="zlxmyibao_" class="easyui-combobox"  panelHeight='auto'
							data-options="label:'有无医保：',width:150,labelAlign:'right'">   
								  	 <option  selected="selected">有</option>   
	 								 <option>无</option>   
						</select>
					</div>
					<!--费用框  -->
					<div style="border:1px solid none;float:left;margin-top:5px;margin-left:15px;">	
							<div style="border:1px solid none;float:left;width:100px;">总计:<span style="color:red;width:100px;" id="xmzj">0</span>元</div>	
							<div style="border:1px solid none;float:left;width:80px;">优惠:<span id="yh"style="color:red;width:100px;">0</span>元</div>					
							<div style="border:1px solid none;float:left;width:130px;">应收:<span  id="xmyf" style="color:red;width:100px;">0</span>元</div>
							<div style="border:1px solid none;float:left;width:130px;">实收:<input type="text" id="sf" value="0"style="color:red;width:50px;height:18px;font-size:15px;border:none;"/>元</div>
							<div style="border:1px solid none;float:left;width:110px;">找零:<span id="zl"style="color:red;width:100px;">0</span>元</div>
					</div>
					<div style="border:1px solid none;folat:left;">		
							<span style="margin-left:20px;"><a class='easyui-linkbutton' id="xmpxh">确认收费</a></span>
					</div>	
				</div>
					<div class="yyy" style="margin-top:15px;">
					<table id="xiangmu_table" singleSelect="true" style="margin-top:10px;height:200px;width:1120px;">
					</table>
					</div>
			</fieldset>
			<!-- =============项目收费底部盒子===========  -->
			<div class="easyui-layout" style="width:550;border:none;margin-top:15px;width:1140px;margin-left:10px;">
				<div class="xiangmu_shoufei" style="margin-bottom:10px;">
					<span>
						<input name="K_id" id="card6"class="easyui-searchbox" 
						data-options="label:'医疗卡号：',prompt:'请输入医疗卡号',width:260,labelAlign:'right'">	
					</span>
				</div>
				<!-- 底部表格 -->
				<div>
					<table id="xiangmushoufei_pxh" singleSelect="true" style="height:250px;width:1122px;" class="easyui-datagrid" data-options="fitColumns:true">		
					</table>
				</div>
			</div>
	</div>
	</div>
	<!-- ==========================================以下都是一系列收费票据============================= -->
	<!-- 药品收费票据 -->
	<div id="yaopinshoufei" class="easyui-window" data-options="modal:true,maximizable:false,closed:true" title="药品收费单据" style="width:625px;padding:10px;">
			<h3 style="margin-left:200px;">平安医院药品收费票据</h3>
					<span style="float:right;">收费时间:<span id="ypsfsj"></span></span>
					<span style="float:left;">编号:<span style="color:red;" id="ypsfbh"></span></span>
			<table id="yaopingshoufeidj" class="hh" style="width:590px;height:300px;"
			    	data-options="fitColumns:true,"> 		
			</table>
				<p>-------------------------------------------------------------------------------------------------</p>
					<span style="margin-left:-5px;width:100px;">应收：<span style="color:red;" id="yfys"></span>元</span> 
					<span  style="margin-left:20px;width:100px;">实收：<span  style="color:red;" id="yfss"></span>元</span>
					<span  style="margin-left:20px;width:100px;">找零：<span  style="color:red;" id="yfzl"></span>元 </span>
					<span style="margin-left:20px;width:100px;">优惠：<span  style="color:red;" id="yfyh"></span>元</span> 
				 	<span style="margin-left:20px;width:100px;">病人姓名：<span id="yfbrxm"></span></span>
					<span  style="margin-left:20px;width:100px;">收款人：<span id="yfskr"></span></span> 
				<p>
				<span style="float:right;margin-top:-6px;margin-right:30px;"><a class='easyui-linkbutton ydpj' id="ydwc">打印完成</a></span>
				</p>
	</div>
	<!--体检收费票据 -->
	<div id="tijianshoufei" class="easyui-window" data-options="modal:true,maximizable:false,closed:true" title="体检收费单据" style="width:625px;padding:10px;">
			<h3 style="margin-left:200px;">平安医院体检收费票据</h3>
					<span style="float:right;">收费时间:<span id="tjsfsj"></span></span>
					<span style="float:left;">编号:<span style="color:red;" id="tjsfbh"></span></span>
			<table id="tijianshoufeidj" class="tj" style="width:590px;height:300px;"
			    	data-options="fitColumns:true,"> 		
			</table>
				<p>-------------------------------------------------------------------------------------------------</p>
				
					<span style="margin-top:-10px;width:100px;">总计：<span style="color:red;" id="tjzje"></span>元</span>
					<span style="margin-left:15px;width:100px;">应收：<span style="color:red;" id="tjpjys"></span>元</span> 
					<span  style="margin-left:20px;width:100px;">实收：<span  style="color:red;" id="tjpjss"></span>元</span>
					<span  style="margin-left:20px;width:100px;">找零：<span  style="color:red;" id="tjpjzl"></span>元 </span>
					<span style="margin-left:20px;width:100px;">优惠：<span  style="color:red;" id="tjpjyh"></span>元</span> 
				<p>
				<span style="margin-top:50px;width:100px;">病人姓名：<span id="tjbrxm"></span></span>
				<span  style="margin-left:20px;width:100px;">收款人：<span id="tjskr"></span></span>
				<span style="float:right;margin-top:-6px;margin-right:30px;"> <a class='easyui-linkbutton tjpj' id="tjwc">打印完成</a></span> 
				</p>
	</div>
	<!--治疗项目收费票据 -->
	<div id="zhiliaoshoufei" class="easyui-window" data-options="modal:true,maximizable:false,closed:true" title="项目收费单据" style="width:625px;padding:10px;">
			<h3 style="margin-left:200px;">平安医院治疗项目收费票据</h3>	
					<span style="float:left;">编号:<span style="color:red;" id="xmsfbh"></span></span>
					<span style="float:right;">收费时间:<span id="xmsfsj"></span></span>
			<table id="zhiliaoxiangmudj" class="zl" style="width:590px;height:300px;"
			    	data-options="fitColumns:true,"> 		
			</table>
				<p>-------------------------------------------------------------------------------------------------</p>
				
					<span style="margin-top:-10px;width:100px;">总计：<span style="color:red;" id="xmpjzj"></span>元</span>
					<span style="margin-left:15px;width:100px;">应收：<span style="color:red;" id="xmpjys"></span>元</span> 
					<span  style="margin-left:20px;width:100px;">实收：<span style="color:red;" id="xmpjss"></span>元</span>
					<span  style="margin-left:20px;width:100px;">找零：<span style="color:red;" id="xmpjzl"></span>元 </span>
					<span style="margin-left:20px;width:100px;">优惠：<span  style="color:red;" id="xmpjyh"></span>元</span> 
				<p>
				<span style="margin-top:50px;width:100px;">病人姓名：<span id="xmbrxm"></span></span>
				<span  style="margin-left:20px;width:100px;">收款人：<span id="xmskr"></span></span>
				<span style="float:right;margin-top:-6px;margin-right:30px;"> <a class='easyui-linkbutton xmpj' id="xmwc">打印完成</a></span> 
				</p>
	</div>
	<!--治疗项目收费详情 -->
	<div id="zhiliaoxiangmuxq" class="easyui-window" data-options="modal:true,maximizable:false,closed:true" title="医疗项目详情" style="width:604px;">
			<table id="zlxmxq" class="xmyx" style="width:590px;height:300px;"
			    	data-options=""> 			
			</table>
	</div>
	<!--体检项目收费详情 -->
	<div id="tijianshoufeixq" class="easyui-window" data-options="modal:true,maximizable:false,closed:true" title="体检项目详情" style="width:604px;">
			<table id="tjxmxq" class="tjyx" style="width:590px;height:300px;"
			    	data-options=""> 			
			</table>
	</div>
	<!--药品收费详情 -->
	<div id="yaopingshoufeixq" class="easyui-window" data-options="modal:true,maximizable:false,closed:true" title="药品收费详情" style="width:604px;">
		<table id="ypsfxq" class="ypyx" style="width:590px;height:300px;"
			    	data-options=""> 					
		</table>
	</div>
	<!-- 药品收费完成弹框 -->
		<div id="ypsfwc" class="easyui-window" title="收费完成" style="width:300px;height:190px;"
				data-options="iconCls:'',modal:true,maximizable:false,closed:true">
					<div style="margin:35px;margin-left:100px;font-size:16px;">收费完成！！！</div>
				<p>
					<a class='easyui-linkbutton' id="ypdy"style="margin-left:105px;">打印票据</a>
				</p>
		</div>
	<!-- 体检收费完成弹框 -->
		<div id="tjsfwc" class="easyui-window" title="收费完成" style="width:300px;height:190px;"
				data-options="iconCls:'',modal:true,maximizable:false,closed:true">
					<div style="margin:35px;margin-left:100px;font-size:16px;">收费完成！！！</div>
				<p>
					<a class='easyui-linkbutton' id="tjdy"style="margin-left:105px;">打印票据</a>
				</p>
		</div>
	<!-- 治疗项目完成弹框 -->
		<div id="zlxmwc" class="easyui-window" title="收费完成" style="width:300px;height:190px;"
				data-options="iconCls:'',modal:true,maximizable:false,closed:true">
					<div style="margin:35px;margin-left:100px;font-size:16px;">收费完成！！！</div>
				<p>
					<a class='easyui-linkbutton' id="xmdy"style="margin-left:105px;">打印票据</a>
				</p>
		</div>
</body>
</html>